package com.ymm.platform.api.facade;

import com.github.pagehelper.PageInfo;
import com.ymm.platform.api.constants.dto.request.ComplaintsInfoRequest;
import com.ymm.platform.api.constants.dto.response.ComplaintsInfoResponse;
import com.ymm.platform.api.constants.dto.response.ComplaintsStateResponse;
import com.ymm.platform.api.constants.dto.response.PendingComplaintsInfoResponse;
import com.ymm.platform.api.utils.Result;
import org.apache.rocketmq.client.exception.MQBrokerException;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.remoting.exception.RemotingException;

import java.util.List;

/**
 * @Description: 客户申诉服务
 * @Author: Xuecheng Li
 * @CreateTime: 2022-08-12  18:02
 * @Version: 1.0.0
 */
public interface ComplaintsService {

    /**
     * 查询指定申诉的申诉简略信息
     * @Param: [complaintsId]
     * @return: com.ymm.platform.api.utils.Result<com.ymm.platform.api.constants.dto.response.ComplaintsInfoResponse>
     */
    Result<ComplaintsInfoResponse> queryComplaintsInfoByComplaintsId(Long complaintsId);

    /**
     * 用户提交申诉请求
     * @Param: complaintsInfo
     * @return: Result
     */
    Result commitComplaints(ComplaintsInfoRequest complaintsInfo);

    /**
     * 用户查看历史申诉包含处理结果
     * @Param: [userId]
     * @return: Result<List<ComplaintsInfoResponse>>
     */
    Result<List<ComplaintsInfoResponse>> queryComplaintsInfo(Long userId);

    /**
     * 用户根据订单id查询申诉状态
     * @Param: [orderId]
     * @return: com.ymm.platform.api.utils.Result<java.lang.Integer>
     */
    Result<ComplaintsStateResponse> queryComplaintsStateByOrderId(Long orderId);

    /**
     * 用户取消指定申诉
     * @Param: [complaintsId]
     * @return: Result
     */
    Result cancelComplaints(Long complaintsId);

    /**
     * 平台查询所有的待处理申诉
     * @Param: []
     * @return: Result<List<PendingComplaintsInfoResponse>>
     */
    Result<PageInfo<PendingComplaintsInfoResponse>> queryPendingComplaints(Integer pageNum, Integer pageSize);

    /**
     * 提交申诉处理结果
     * @Param: []
     * @return: Result
     */
    Result commitComplaintsHandleComment(Long complaintsId, String handleDsc) throws MQBrokerException, RemotingException, InterruptedException, MQClientException;
}
